/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * <p></p>
 * <p>Powered by webrx On 2023-03-24 14:55:31</p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
@WebServlet("/post")
public class Post extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        System.out.println(req.getParameter("id"));
        System.out.println(req.getParameter("color"));

        //1985年12月15日
        //LocalDateTime birth = LocalDateTime.parse(req.getParameter("birth"), DateTimeFormatter.ofPattern("yyyy-MM-dd'T'hh:mm"));
        //System.out.println(birth);

        System.out.println(req.getParameter("birth"));

        if(req.getParameter("teacher")==null){
            System.out.println("学生登录");
        }else{
            System.out.println("老师登录");
        }
    }
}
